import Cookies from 'js-cookie'

const userInfoCookies = {
  setToken (token) {
    Cookies.set('token', token)
  },
  getToken () {
    return Cookies.get('token')
  },
  removeToken () {
    Cookies.remove('token')
  },
  setUserName (userName) {
    Cookies.set('userName', userName, { expires: 7 })
  },
  getUserName () {
    return Cookies.get('userName')
  },
  setPassWord (passWord) {
    Cookies.set('passWord', passWord, { expires: 7 })
  },
  getPassWord () {
    return Cookies.get('passWord')
  },
  removeUserInfo () {
    Cookies.remove('passWord')
    Cookies.remove('userName')
    Cookies.remove('token')
  }
}

export { userInfoCookies }
